﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class TimKiemPhuKien : System.Web.UI.Page
{
    DataTable dt = new DataTable();
    KetNoi obj = new KetNoi();
    protected void Page_Load(object sender, EventArgs e)
    {
        string maloaipk = Request.QueryString["MaLoaiPK"].ToString();
        int giatu = Convert.ToInt32(Request.QueryString["giatu"].ToString());
        int giaden = Convert.ToInt32(Request.QueryString["giaden"].ToString());
        dt = obj.TimPhuKienTheoGia(maloaipk, giatu, giaden);
        if (dt.Rows.Count > 0)
        {
            Repeater5.DataSource = dt;
            Repeater5.DataBind();
        }
        else
        {
            lblthongbao.Text = "Không có kết quả nào được tìm thấy";
        }
    }
    protected void LoadRepeater()
    {
        string maloaipk = Request.QueryString["MaLoaiPK"].ToString();
        int giatu = Convert.ToInt32(Request.QueryString["giatu"].ToString());
        int giaden = Convert.ToInt32(Request.QueryString["giaden"].ToString());
        dt = obj.TimPhuKienTheoGia(maloaipk, giatu, giaden);
        Repeater5.DataSource = dt;
        Repeater5.DataBind();
    }
}
